<?php

namespace App\Http\Controllers\Index;
use App\Http\Controllers\Index\UserAuth;
use Illuminate\Http\Request;

class User extends UserAuth
{
    public function __construct(Request $request)
    {
        parent::__construct($request);

    }

    public function index(){

//        var_dump(session('user'));
        $userName = $this->userName;
        return view('index.user')->with(['userName'=>$userName]);
    }

    public function logout(Request $request){
        $request->session()->forget('user');
        redirect('/login')->send();
    }

}
